import json
d = dict(name='jack', age=20)
# print(json.d)


class Student(object):
    def __init__(self, name, age):
        self.name = name
        self.age = age


def student2dict(std):
    return {
        'name' : std.name,
        'age' : std.age
    }
s = Student('lisi',20)
a = student2dict(s)
print(a)